var express = require('express');
var router = express.Router();
var pool = require('../db')

console.log(pool);

/* GET users listing. */
router.get('/', function(req, res, next) {
  // nodemon实时更新
  res.send('123456');
});
// 登录接口
router.post('/login',function(req,res,next){
  // post传参 req.body
  // get传参  req.query
  console.log(req.body);
  const { userName,passWord } = req.body

  //查询数据 pool.query
  pool.query('select * from user')

  res.send('我是登录接口')
})
module.exports = router;
